package cn.edu.neusoft.demo.hospital2.Service.impl;

import cn.edu.neusoft.demo.hospital2.Dao.HospitalIntroductionDao;
import cn.edu.neusoft.demo.hospital2.pojo.HospitalIntroduction;
import cn.edu.neusoft.demo.hospital2.Service.HospitalIntroductionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HospitalIntroductionServiceImpl implements HospitalIntroductionService {

    @Autowired
    private HospitalIntroductionDao hospitalIntroductionDao;

    @Override
    public List<HospitalIntroduction> getAllHospitalIntroductions() {
        return hospitalIntroductionDao.getAllHospitalIntroductions();
    }

    @Override
    public HospitalIntroduction getHospitalIntroductionById(Integer introId) {
        return hospitalIntroductionDao.getHospitalIntroductionById(introId);
    }

    @Override
    public int addHospitalIntroduction(HospitalIntroduction introduction) {
        return hospitalIntroductionDao.insert(introduction);
    }

    @Override
    public int updateHospitalIntroduction(HospitalIntroduction introduction) {
        return hospitalIntroductionDao.updateById(introduction);
    }

    @Override
    public int deleteHospitalIntroduction(Integer introId) {
        return hospitalIntroductionDao.deleteById(introId);
    }
}